package com.aspose.cells;

class zasz implements zahj {
   private int a;
   private zaay b;
   private zagu c;
   private double d = 0.0D;
   private double e = 0.0D;
   private double f = 0.0D;
   private double g = 0.0D;
   private int h = 0;

   zasz(int var1, zaay var2, zagu var3) {
      this.a = var1;
      this.b = var2;
      this.c = var3;
   }

   public zagu a(double var1, double var3) {
      ++this.h;
      this.e += var1;
      this.d += var3;
      this.f += var1 * var3;
      this.g += var3 * var3;
      return null;
   }

   public zagu a(double var1, double var3, int var5) {
      this.h += var5;
      var1 *= (double)var5;
      this.e += var1;
      this.f += var1 * var3;
      var3 *= (double)var5;
      this.d += var3;
      this.g += var3 * var3;
      return null;
   }

   public zagu a() {
      double var1 = this.g * (double)this.h - this.d * this.d;
      if (var1 == 0.0D) {
         return zza.a;
      } else {
         double var3 = (this.f * (double)this.h - this.d * this.e) / var1;
         double var5;
         switch(this.a) {
         case 309:
            var5 = this.e / (double)this.h - var3 * this.d / (double)this.h;
            double[] var9 = new double[1];
            zyz var10 = zaaq.a(new zagu[]{this.c}, this.b, 0, (double[])var9, 7);
            if (var10 != null) {
               return var10;
            }

            return zaaq.a(var5 + var3 * var9[0]);
         case 311:
            var5 = this.e / (double)this.h - var3 * this.d / (double)this.h;
            return zaaq.a(var5);
         case 315:
            return zaaq.a(var3);
         default:
            throw new CellsException(7, "Invalid function in FORECAST algorithm.");
         }
      }
   }

   public zagu b() {
      return zza.a;
   }
}
